package com.zhang.blog.utils;

import com.zhang.blog.entity.SysUser;

/**
 * @ClassName: UserThreadLocal
 * @Auther: dell
 * @Date: 2021/10/31 20:34
 * @Description:
 */
public class UserThreadLocal {

    private UserThreadLocal(){}
    //线程变量隔离
    private static final ThreadLocal<SysUser> LOCAL = new ThreadLocal<>();

    public static void put(SysUser sysUser){
        LOCAL.set(sysUser);
    }
    public static SysUser get(){
        return LOCAL.get();
    }
    public static void remove(){
        LOCAL.remove();
    }
}
